<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\DB;

class MailList extends Base
{

    public function logic()
    {
        $uid = $this->uid;
        $row = DB::table('t_mail_info')->where('uid',$uid)->orderBy('create_time')->get()->map(function ($value){
            return (array)$value;
        });
        $ac_arr = array();
        foreach ($row as $a) {
            $arr['id']          = (int)$a['id'];
            $arr['to_uid']      = (int)$a['uid'];
            $arr['head']        = $a['head'];
            $arr["content"]     = $a['content'];
            $arr["if_get"]      = (int)$a["status"];
            $arr["create_time"] = $a["create_time"];
            $ac_arr[]           = $arr;
        }
        return $this->returnData(array("mail_list" => $ac_arr));
    }

}
